<template>
  <div class="login">
    <div class="login-form">
      <h2>用户登录</h2>
      <el-form ref="form">
        <el-form-item label="用户">
          <el-input v-model="form.account"></el-input>
        </el-form-item>
        <el-form-item label="密码">
          <el-input v-model="form.password" type="password"></el-input>
        </el-form-item>
        <el-form-item label="" style="margin-bottom: 35px;">
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="login">登录</el-button>
          <el-button @click="login">重置</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  props: {},
  data() {
    return {
      form: {
        account: 'admin',
        password: '123456'
      }
    }
  },
  methods: {
    login() {
      this.$store.commit('login', {
					Token: 'this is token',
					account: this.form.account,
					password: this.$utils.doData.md5(this.form.password),
					loginTime: this.$utils.formatter.moment().format('YYYY-MM-DD HH:mm:ss')
				})
      this.$router.push({
					path: '/',
					query: {
						date: new Date().getTime()
					}
				});
    }
  }
};
</script>